Skip to content

fix(mcp): adapt to mcp 2.0.0 SDK API changes - #344

Closed
1Beekeeper wants to merge 1 commit into
HKUDS:mainfrom
1Beekeeper:fix/mcp-2-0-compat
Closed

fix(mcp): adapt to mcp 2.0.0 SDK API changes#344
1Beekeeper wants to merge 1 commit into
HKUDS:mainfrom
1Beekeeper:fix/mcp-2-0-compat

Conversation

@1Beekeeper

Copy link
Copy Markdown

Summary

  • pyproject.toml's mcp>=1.0.0 constraint currently resolves to mcp==2.0.0, a breaking release of the official MCP Python SDK, which broke uv run pytest on a fresh clone (ModuleNotFoundError: No module named 'mcp.server.fastmcp').
  • Adapts the codebase and tests to the 2.0.0 API instead of pinning to an older SDK version:
    • mcp.server.fastmcp.FastMCP -> mcp.server.mcpserver.MCPServer
    • transport_security moved from the MCPServer() constructor to .streamable_http_app()
    • Tool.inputSchema -> Tool.input_schema, CallToolResult.structuredContent -> CallToolResult.structured_content (SDK renamed several fields to snake_case)
    • streamable_http_client(...) now yields a 2-tuple (read_stream, write_stream) instead of 3 (dropped an unused session-id callback)

Test plan

  • uv run pytest -q — 1153 passed, 6 skipped, 0 failed (previously failed at collection)

🤖 Generated with Claude Code

The mcp>=1.0.0 dependency resolves to 2.0.0, a breaking release that
renamed FastMCP->MCPServer (mcp.server.fastmcp->mcp.server.mcpserver),
moved transport_security from the constructor to streamable_http_app(),
renamed several Tool/CallToolResult fields to snake_case
(inputSchema->input_schema, structuredContent->structured_content), and
dropped the unused session-id callback from streamable_http_client's
return tuple.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@1Beekeeper 1Beekeeper closed this by deleting the head repository Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants